#include "PersonalDiary.h"
#include <iostream>

using namespace std;

int main(){
    string date,content;
    cout << "Enter date (YYYY-MM-DD):" << endl;
    cin >> date;
    cin.ignore();//忽略换行符

    string line;
    cout << "Enter content (enter . on a line by itself to finish):" << endl;
    while(getline(cin,line) && line != "."){
        content += "\n" + line  ;
    }
    content += "\n ##end##";//在内容末尾添加结束标记

    PersonalDiary diary("data_file.txt");
    diary.addEntity(date,content);
    cout << "Entity added successfully."<<endl;
    return 0;
}